<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="header.jsp" %>
<html>
<head>
    <title>注册</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
</head>
<body>
<div class="container">
    <div class="form-container">
        <h2>用户注册</h2>
        <form action="${pageContext.request.contextPath}/register" method="post">
            <div class="form-group">
                <label for="username">用户名:</label>
                <input type="text" id="username" name="username" required>
            </div>
            <div class="form-group">
                <label for="password">密码:</label>
                <input type="password" id="password" name="password" required>
            </div>
            <div class="form-group">
                <label for="confirmPassword">确认密码:</label>
                <input type="password" id="confirmPassword" name="confirmPassword" required>
            </div>
            <div class="form-group">
                <label for="name">姓名:</label>
                <input type="text" id="name" name="name" required>
            </div>
            <div class="form-group">
                <label for="contactInfo">联系方式:</label>
                <input type="text" id="contactInfo" name="contactInfo" required>
            </div>
            <div class="form-group">
                <label>角色:</label>
                <select name="role" required>
                    <option value="系统管理员">系统管理员</option>
                    <option value="用户">用户</option>
                </select>
            </div>
            <div class="form-group">
                <button type="submit">注册</button>
            </div>
            <div class="form-footer">
                <p>已有账号? <a href="${pageContext.request.contextPath}/jsp/login.jsp">立即登录</a></p>
            </div>
            <div class="error-message">${error}</div>
            <div class="success-message">${success}</div>
        </form>
    </div>
</div>
</body>
</html>